<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var a={}
        var b={
            name:'temo',
            age:10
        }
        Object.prototype.extends=function(obj){
            for(let key in obj){
                this[key]=obj[key];

            }
            return this;
        }
        // 继承
        a.extends(b);
        console.log(a);
        console.log(b);
    </script>
</body>
</html>